#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "client.h"
#include "callbacks.h"

int main (int argc, char *argv[])
{
	if ( argc != 2)
	{
		printf ("Usage: ./client 127.0.0.1\n");
		exit (EXIT_FAILURE);
	}

	g_thread_init (NULL);
	gdk_threads_init ();

	memset (server_ip, 0, 16);
	strcpy (server_ip, argv[1]);
	net_init (server_ip);
	gtk_init (&argc, &argv);

	init_builder = get_builder (INIT);
 	GtkWindow *window = GTK_WINDOW (gtk_builder_get_object (init_builder, "window"));
	gtk_window_present (window);

	gdk_threads_enter ();
	gtk_main ();
	gdk_threads_leave ();
}

